//
//  NSString+Utils.h
//  KKMYForU
//
//  Created by 黄磊 on 13-10-31.
//  Copyright (c) 2013年 黄磊. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface NSString (Utils)

// 本地字符串替换
+ (NSString *)localizedString:(NSString *)format, ... NS_REQUIRES_NIL_TERMINATION ;
// NS_REQUIRES_NIL_TERMINATION;

// 获取域名
+ (NSString *)getBaseHost;
+ (NSString *)getSourceUrl;

// 检查电话号
- (BOOL)checkPhoneNum;
// 检查手机号
- (BOOL)checkMobileNum;
// 检查输入字符串

- (BOOL)checkText;
// 是否包含表情
+ (BOOL)isContainsEmoji:(NSString *)string;
// 转换成带星星的电话号
- (NSString *)convertToCoverTel;
// 计算以小时为单位的时间
+ (NSString *)getHourWithMinute:(float)minute;
// 计算字符串高度
- (float)heightWithFont:(UIFont *)font andWidth:(float)width;
- (float)calculateHeightWithFont:(UIFont *)font andWidth:(float)width;  // 已无地方调用
// 版本号检查
- (BOOL)isNewThanVersion:(NSString *)oldVersion;
// 时间戳转换
- (NSString *)convertToTimeString;
- (NSString *)convertTimeString;
- (NSString *)compareWihtTime:(NSString *)curTime;

+ (NSString *)generateUniqueId;
+ (NSString *)getDocumentLocation;
+ (NSString *)getTempLocation;
+ (NSString *)getImageLocation;
+ (NSString *)getAvatarLocation;
+ (NSString *)getAudioLocation;
+ (NSString *)timestampConvertString:(long long)time;

+ (NSString *)halfHourAfterCurrentTime;
+ (NSString *)oneDayAfterCurrentTime;
+ (NSString *)oneDayBeforeCurrentTime;
+ (NSString *)timestampConvertString:(long long)time dataFormat:(NSString *)dataFormat;
+ (NSString*)getLaunchImage;
+ (NSString *)isFullUrl:(NSString *)urlStr;

+ (NSString*)URLencode:(NSString *)originalString
        stringEncoding:(NSStringEncoding)stringEncoding;

- (NSString *)getShortUrl;

//去除首尾空格
-(NSString *)trim;

//判断在srcStr中是否存在destStr，如果存在返回YES
+ (BOOL)isExistString:(NSString *)srcStr fingStr:(NSString *)destStr;

// 获取得照片信息转成对应路径
+ (NSString *)prepareImageWithDic:(NSDictionary *)info;

@end
